package com.ihunanren.taobao;

/**
 * @author kalman03
 */
public enum CouponsReason {

	unvalid_sign(1, "非法请求，请重试！"), 
	
	obtain_out_of_times(2, "今日已到领取上限，明天再来吧。"),
	
	unlogin(3,"领取优惠劵的前提是你必须先登录淘宝网，不然怎么知道领取给谁用呢？！<a href=\"https://login.taobao.com/member/login.jhtml\" target=\"_blank\">前往登录</a><br/>");
	
	private int key;
	private String value;

	private CouponsReason(int key, String value) {
		this.key = key;
		this.value = value;
	}
	
	public static String getReasonByKey(int key){
		for(CouponsReason reason : CouponsReason.values()){
			if(reason.getKey() == key){
				return reason.getValue();
			}
		}
		return null;
	}

	public int getKey() {
		return key;
	}

	public String getValue() {
		return value;
	}

}
